from selenium import webdriver
import time
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

#啊啊啊

#driver = webdriver.Chrome()
#使用远程环境
driver = webdriver.Remote(command_executor="http://106.15.249.13:4442/wd/hub",desired_capabilities=DesiredCapabilities.CHROME.copy())

driver.maximize_window()
driver.implicitly_wait(30)

host = "https://testhb.turingtopia.com/"
# 首页登录
driver.get(host)
driver.find_element_by_xpath('//input[@type="text"]').send_keys("chenjian")

driver.find_element_by_xpath('//input[@type="password"]').send_keys("chenjian")

#driver.find_element_by_xpath('//button[@auto-test-id="login__input-login"]').click()
driver.find_element_by_css_selector('.dc-button-big.primary').click()

time.sleep(10)

#切换到子页面
js_new_window = 'window.open("")'
driver.execute_script(js_new_window)

driver.switch_to.window(driver.window_handles[-1])
driver.get("https://testhb.turingtopia.com/flow/041db4a0373d4062a179eb73a7d71fbd/v4?flowId=1513")
time.sleep(10)
#退出浏览器
driver.quit()